package com.xinlong.man;

import com.xinlong.entity.Userinfo;
import com.xinlong.service.IuserService;
import com.xinlong.service.impl.UserServiceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.util.ClassUtils;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileNotFoundException;

public class main {

    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
    public static String encodePassword(String password){
        return bCryptPasswordEncoder.encode(password);
    }




    public static void main(String[] args) throws FileNotFoundException {
//        String password = "admin";
//        String pwd = encodePassword(password);
//        System.out.println(pwd);
//        File path = new File(ResourceUtils.getURL("classpath:").getPath());
//        System.out.println(path);
//        File uploadpath = new File(path.getAbsolutePath(),"static/img/headImg/");
//        System.out.println("uploadpath:"+uploadpath.getAbsolutePath());
//
//        System.out.println(Class.class.getClass().getResource("/").getPath());
        IuserService iuserService=new UserServiceimpl();
        Userinfo findbyname = iuserService.findbyname("admin");
        System.out.println(findbyname);





    }
}
